package com.xtaller.sdboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper; 
import com.xtaller.sdboot.entity.IamDepartment;
import com.xtaller.sdboot.entity.IamUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/** 
* 代码生成 
* @author: Taller  
* @date: 2020-03-30 09:57:22
* @Description: 组织架构 
*/ 
public interface IamDepartmentMapper extends BaseMapper<IamDepartment> {
    @Select("SELECT id,realName, mobile FROM iam_user a " +
            "where (realName like '${key}%' or mobile like '${key}%') and isDeleted=0 " +
            "and id in (select userId from iam_user_application where appId=#{appId} and isDeleted=0)")
    List<IamUser> findUserByKey(@Param("key") String key, @Param("appId") String appId);
} 
